package day06;

import java.util.Arrays;

public class ns {
    public static void main(String[] args) {
        int[] a = new int[10];
        for (int i = 0;i<a.length;i++){
            a[i] = (int) (Math.random()*1000);
        }
        System.out.println(Arrays.toString(a));
        System.out.println( getMaxArray(a));

    }
    public static int getMaxArray(int[] a){
        int max = a[0];
        for (int i = 1;i<a.length;i++){
            if (a[i]>max){
                max = a[i];
            }
        }
        return max;
    }
}
